package com.nuoyun.tnvmue.activity.fragment

import android.app.Dialog
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.nuoyun.tnvmue.R
import com.nuoyun.tnvmue.activity.BuyVipActivity
import com.nuoyun.tnvmue.activity.ExchangeActivity
import com.nuoyun.tnvmue.activity.SettingActivity
import kotlinx.android.synthetic.main.fragment_mine.*
import kotlinx.android.synthetic.main.view_title_bar_1.*
import per.goweii.anylayer.AnyLayer

/**
 * @author JiangAdmin
 * date: 2020/4/10
 * Email: jiangmr@vip.qq.com
 * TODO: 我的
 */

class MineFragment : BaseFragment() {
    val TAG = "MineFragment"

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {

        return inflater.inflate(R.layout.fragment_mine, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        autoTitleHeight(view_title_bar)

        search.visibility = View.GONE
        esc.visibility = View.GONE
        title.text = "会员中心"

        showHelp(true)
        showNews(true)

        sign.setOnClickListener {
            AnyLayer.with()
                    .contentView(R.layout.dialog_sign)
                    .backgroundColorRes(R.color.black_6)
                    .backgroundBlurPercent(0.01F)
                    .gravity(Gravity.CENTER)
                    .show()
        }

        exchange.setOnClickListener { ExchangeActivity.start(activity!!) }
        setting.setOnClickListener { SettingActivity.start(activity!!) }
        buyvip.setOnClickListener { BuyVipActivity.start(activity!!) }

    }

}
